<template>
  <view class="jumpBox" @click="jumptabCard">
    <text>
      {{ item.name }}
    </text>
    <view>
      <image :src="type" mode="widthFix" class="colorBox_img" />
      <text>{{ typename }}</text>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      icon: [
        require("../static/img/bd.png"),
        require("../static/img/tuji_card.png"),
      ],
    };
  },
  computed: {
    type() {
      if (this.item.contentSubType == 41) {
        return this.icon[1];
      } else if (this.item.contentSubType == 42) {
        return this.icon[0];
      }
    },
    typename() {
      if (this.item.contentSubType == 41) {
        return "图片合集";
      } else if (this.item.contentSubType == 42) {
        return "新品榜单";
      }
    },
  },
  created() {},
  mounted() {},
  methods: {
    jumptabCard() {
      let url = "";
      if (this.item.contentSubType == 42) {
        url = "/pages/crunchies/crunchies?id=" + this.item.id;
      } else if (this.item.contentSubType == 41) {
        url = "/pages/picAtlas/picAtlas?id=" + this.item.id;
      }
      uni.navigateTo({
        url,
      });
    },
  },
};
</script>

<style scoped lang="scss" scoped>
.jumpBox {
  padding-top: 57rpx;
  padding-left: 25rpx;
  padding-right: 49rpx;
  padding-bottom: 42rpx;
  width: 328rpx;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(
    90deg,
    rgba(179, 30, 34, 1) 0%,
    rgba(255, 0, 0, 1) 100%
  );
  border-radius: 14rpx;

  > text {
    font-size: 34rpx;
    font-family: Source Han Sans CN;
    font-weight: 800;
    color: rgba(254, 254, 254, 1);
    line-height: 40rpx;
  }

  > view {
    margin-top: 97rpx;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;

    > image {
      width: 36rpx;
      max-height: 36rpx;
    }

    > text {
      font-size: 28rpx;
      font-family: PingFang SC;
      font-weight: 400;
      color: rgba(255, 255, 255, 1);
      white-space: nowrap;
      margin-left: 12rpx;
    }
  }
}
</style>
